#include <iostream>
using namespace std;
const int N = 110;
int a[N];
int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n + 1; i++)
    {
        cin >> a[i];
    }
    int flag = true;
    for (int i = 0; i <= n; i++)
    {
        int coef = a[i];
        int deg = n - i;
        if(a[i] == 0) continue;
        if (flag)
        {
            if (a[i] < 0)
                cout << "-";
        }
        else
        {
            if(a[i] < 0) cout << "-";
            else {
                cout << "+";
            }
        }
        int abs_coef = abs(coef);
        if(deg == 0) {
            cout << abs_coef;
        }else if(deg == 1){
            if(abs_coef != 1) cout << abs_coef;
            cout << "x";
        }else {
            if(abs_coef != 1) cout << abs_coef;
            cout << "x^" << deg;
        }
        flag = false;
    }
    return 0;
}